/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.f.b;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.f;
import com.qihoo.gamecenter.sdk.common.i.s;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class c extends d {
    private boolean b = false;

    public c(Context paramContext, d.a parama, boolean paramBoolean) {
        super(paramContext, parama, true);
        this.b = paramBoolean;
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "http://mgame.360.cn/credit/acc_query.json";
    }

    protected boolean b() {
        return true;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str1)) {
            com.qihoo.gamecenter.sdk.pay.k.c.b("GetUserCreditLevelTask",
                    new Object[] { "GetBindCards: qihooId is null!" });
            return null;
        }
        String str2 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str2)) {
            com.qihoo.gamecenter.sdk.pay.k.c.b("GetUserCreditLevelTask",
                    new Object[] { "GetBindCards: access token is null!" });
            return null;
        }
        String str3 = a(2, paramArrayOfString);
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("user_id", str1);
        localTreeMap.put("access_token", str2);
        localTreeMap.put("mobile_num", (str3 == null) ? "" : str3);
        localTreeMap.put("t", String.valueOf(System.currentTimeMillis()));
        if (this.b)
            localTreeMap.put("detail", "priv");
        String str4 = s.a(localTreeMap, s.s(paramContext));
        com.qihoo.gamecenter.sdk.pay.k.c.a("GetUserCreditLevelTask", new Object[] { "params=", str4 });
        if (b()) {
            this.a = s.b();
            String str5 = f.c(str4, this.a);
            String str6 = b.a().a(this.a);
            localTreeMap = new TreeMap();
            localTreeMap.put("k", str6);
            localTreeMap.put("d", str5);
            com.qihoo.gamecenter.sdk.pay.k.c
                    .a("GetUserCreditLevelTask", new Object[] { a(), "?k=", str6, "&d=", str5 });
        }
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            a locala = new a();
            int i = paramJSONObject.optInt("error_code", -1);
            String str = paramJSONObject.optString("error_msg");
            if (i == 0) {
                locala.b(paramJSONObject.optString("mobile"));
                locala.b(paramJSONObject.optInt("credit_level"));
                locala.c(paramJSONObject.optString("credit_limit"));
                locala.d(paramJSONObject.optString("credit_balance"));
                locala.e(paramJSONObject.optString("acct_balance"));
                locala.f(paramJSONObject.optString("repayment_date"));
                locala.c(paramJSONObject.optInt("repayment_days"));
                if (this.b) {
                    locala.g(paramJSONObject.optString("repayment_url"));
                    locala.d(paramJSONObject.optInt("credit_min_limit"));
                    locala.e(paramJSONObject.optInt("credit_max_limit"));
                    locala.f(paramJSONObject.optInt("credit_min_level"));
                    locala.g(paramJSONObject.optInt("credit_max_level"));
                }
            }
            locala.a(i);
            locala.a(str);
            return locala;
        }
        return null;
    }

    public static class a {
        private int a = -1;
        private String b = null;
        private String c;
        private int d = 1;
        private String e;
        private String f;
        private String g;
        private String h;
        private int i = 0;
        private String j = "www.mo9.com";
        private int k;
        private int l;
        private int m;
        private int n;

        public int a() {
            return this.a;
        }

        public boolean b() {
            return (this.a == 0);
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public void a(String paramString) {
            this.b = paramString;
        }

        public String c() {
            return this.c;
        }

        public void b(String paramString) {
            this.c = paramString;
        }

        public int d() {
            return this.d;
        }

        public void b(int paramInt) {
            this.d = paramInt;
        }

        public String e() {
            return this.e;
        }

        public void c(String paramString) {
            this.e = paramString;
        }

        public String f() {
            return this.f;
        }

        public void d(String paramString) {
            this.f = paramString;
        }

        public String g() {
            return this.g;
        }

        public void e(String paramString) {
            this.g = paramString;
        }

        public int h() {
            return this.i;
        }

        public void c(int paramInt) {
            this.i = paramInt;
        }

        public void f(String paramString) {
            this.h = paramString;
        }

        public String i() {
            return this.j;
        }

        public void g(String paramString) {
            this.j = paramString;
        }

        public void d(int paramInt) {
            this.k = paramInt;
        }

        public int j() {
            return this.l;
        }

        public void e(int paramInt) {
            this.l = paramInt;
        }

        public int k() {
            return this.m;
        }

        public void f(int paramInt) {
            this.m = paramInt;
        }

        public int l() {
            return this.n;
        }

        public void g(int paramInt) {
            this.n = paramInt;
        }
    }
}